package com.metacube.questionbank.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.metacube.questionbank.dao.TagDAO;
import com.metacube.questionbank.dto.TagDTO;

@Controller
@RequestMapping("/allTags")
public class getAllTagsController {

	@Autowired
	TagDAO tagDAO; 
	
	@RequestMapping(value = "/all", method = RequestMethod.GET)
	public ModelAndView displayAllTags() {
		
		List<TagDTO> tagList= tagDAO.getAllTags();
		ModelAndView model = new ModelAndView();
		model.addObject("tagList", tagList);
		return model;
	}

}
